package com.jxaummd.mushroom.main.data.presenter;


import com.blankj.utilcode.util.LogUtils;
import com.jxaummd.mushroom.core.base.data.DataSource;
import com.jxaummd.mushroom.core.base.presenter.BasePresenter;
import com.jxaummd.mushroom.main.data.beam.DataBean;
import com.jxaummd.mushroom.main.data.contract.DataContract;
import com.jxaummd.mushroom.main.data.data.DataDataServe;

import java.util.List;

public class DataPresenter extends BasePresenter<DataContract.View>
        implements DataContract.Presenter, DataSource.Callback {

    public DataPresenter(DataContract.View view) {
        super(view);
    }

    @Override
    public void getdata(int mbid) {
        LogUtils.d("被调用");
        DataDataServe.requestData(mbid, this);
    }

    @Override
    public void onDataLoaded(Object o) {
        List<DataBean> data = (List<DataBean>) o;
        getView().updateChart(data);
    }

    @Override
    public void onDataNotAvailable(int strRes) {

    }
}
